package com.woniuxy.stage3demo.mapper.gy;

import com.woniuxy.stage3demo.bean.gy.CollectionLogBean;
import org.apache.ibatis.annotations.*;
import org.springframework.stereotype.Service;

import java.util.List;

@Mapper
public interface OverdueCollectionLogMapper {

    //根据订单ID查询催收信息
    public List<CollectionLogBean> findAll(@Param("id") int id);


    //查询催收信息的所有与本人关系
    @ResultType(Integer.class)
    @Select("select relationship from collection_log")
    public List<Integer> findAllRelationship();


    //催收信息增加表
    @Options(
            useGeneratedKeys = true,
            keyProperty = "c.id"
    )
    @Insert("insert into collection_log(create_time,stuff_id,collection_type," +
            "order_id,result,del_flag,coll_relationship,coll_obj,telphone)values" +
            "(now(),#{c.staffBean.id},#{c.collectionType},#{c.orderBean.id}," +
            "#{c.result},null,#{c.collRelationship}" +
            ",#{c.collObj},#{c.telphone})")
    public void add(@Param("c") CollectionLogBean collectionLogBean);
}
